.markdown-preview {
    width: 100%;
    height: 100%;
    box-sizing: border-box
}

.markdown-preview .pagebreak,
.markdown-preview .newpage {
    page-break-before: always
}

.markdown-preview pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber
}

.markdown-preview pre.line-numbers>code {
    position: relative
}

.markdown-preview pre.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 1em;
    font-size: 100%;
    left: 0;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #999;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

.markdown-preview pre.line-numbers .line-numbers-rows>span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber
}

.markdown-preview pre.line-numbers .line-numbers-rows>span:before {
    content: counter(linenumber);
    color: #999;
    display: block;
    padding-right: .8em;
    text-align: right
}

.markdown-preview .mathjax-exps .MathJax_Display {
    text-align: center !important
}

.markdown-preview:not([for="preview"]) .code-chunk .btn-group {
    display: none
}

.markdown-preview:not([for="preview"]) .code-chunk .status {
    display: none
}

.markdown-preview:not([for="preview"]) .code-chunk .output-div {
    margin-bottom: 16px
}

.scrollbar-style::-webkit-scrollbar {
    width: 8px
}

.scrollbar-style::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: transparent
}

.scrollbar-style::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: rgba(150, 150, 150, 0.66);
    border: 4px solid rgba(150, 150, 150, 0.66);
    background-clip: content-box
}

html body[for="html-export"]:not([data-presentation-mode]) {
    position: relative;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    overflow: auto
}

html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview {
    position: relative;
    top: 0
}

@media screen and (min-width:914px) {
    html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview {
        /*TLW*/
        /* padding: 2em calc(50% - 457px + 2em) */
        padding: 2.54cm 2.18cm;
    }
}

@media screen and (max-width:914px) {
    html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview {
        padding: 2em
    }
}

@media screen and (max-width:450px) {
    html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview {
        font-size: 14px !important;
        padding: 1em
    }
}

@media print {
    html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn {
        display: none
    }
}

html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn {
    position: fixed;
    bottom: 8px;
    left: 8px;
    font-size: 28px;
    cursor: pointer;
    color: inherit;
    z-index: 99;
    width: 32px;
    text-align: center;
    opacity: .4
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn {
    opacity: 1
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    padding: 32px 0 48px 0;
    font-size: 14px;
    box-shadow: 0 0 4px rgba(150, 150, 150, 0.33);
    box-sizing: border-box;
    overflow: auto;
    background-color: inherit
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar {
    width: 8px
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: transparent
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: rgba(150, 150, 150, 0.66);
    border: 4px solid rgba(150, 150, 150, 0.66);
    background-clip: content-box
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a {
    text-decoration: none
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul {
    padding: 0 1.6em;
    margin-top: .8em
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li {
    margin-bottom: .8em
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul {
    list-style-type: none
}

html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview {
    left: 300px;
    width: calc(100% - 300px);
    /*TLW*/
    /* padding: 2em calc(50% - 457px - 150px); */
    padding: 2.54cm 2.18cm;
    margin: 0;
    box-sizing: border-box
}

@media screen and (max-width:1274px) {
    html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview {
        padding: 2em
    }
}

@media screen and (max-width:450px) {
    html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview {
        width: 100%
    }
}

html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview {
    left: 50%;
    transform: translateX(-50%)
}

html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc {
    display: none
}

/* page-break: Firefox, Chrome, 以及 Safari 不支持属性值 "avoid". */
html body {
    /* border:1px solid black; for debug */
    padding: 0 !important;
    margin: 0 !important;
    background-color: #eee;
}

/* 正文区基本属性 */
.mume {
    font-family: 黑体;
    font-size: 12pt;
    /* !!!A4标准宽度 */
    /* max-width: 21cm; */
    margin: 10px;

    /* 添加一个淡灰色的边框 */
    border: 1px solid #CCC;
    /* 自动编号 */
    /* counter-reset: tableHead imgHead h2 h3 h4 h5 h6 !important; */
    /*修复缺失上级标题时无法递增*/
    /* 白色背景 */
    background-color: white;
}

/* 段落 */
.mume p {
    /* 左右对齐 */
    text-align: justify;
    /* 段落缩进两字符 */
    text-indent: 2em;
    /* 1.5 倍行距 */
    line-height: 1.5em;
    /* 2 倍段间距 */
    margin-bottom: 2em;
}

/*页边距处理*/
@media screen {
    .mume {
        padding: 2.54cm 3.18cm;
    }
}

@media print {
    .mume {
        padding: 0 3.18cm !important;
        margin: 0 !important;
    }
}

@page {
    margin: 2.54cm 0;
    /*上下/左右 边距，参考了word的默认边距*/
}

/*引言*/
.mume blockquote {
    font-family: 楷体;
    border-left: 3px solid black;
    padding-left: 10px;
    color: grey;
}


.mume h1 {
    /* 标题居中 */
    text-align: center;
    font-size: 18pt;
    page-break-before: always !important;
    font-weight: bold;
    margin-bottom: 2em;

    @media print {
        page-break-after: avoid !important;
    }
}

.mume h2 {
    font-family: 仿宋;
    text-align: center;
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 2em;
    margin-top: 2em;
    counter-increment: h2;
    counter-reset: h3 h4 h5 h6;
    @media print {
        page-break-after: avoid !important;
    }
}

.mume h3 {
    font-family: 黑体;
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 2em;
    counter-increment: h3;
    counter-reset: h4 h5 h6;
    @media print {
        page-break-after: avoid !important;
    }
}

.mume h4 {
    text-align: center;
    font-family: 楷体;
    font-size: 14pt;
    text-align: left;
    font-weight: bold;
    counter-increment: h4;
    counter-reset: h5 h6;
    margin-bottom: 2em;

    @media print {
        page-break-after: avoid !important;
    }
}

.mume h5 {
    font-weight: bold;
    margin-bottom: 2em;
    counter-increment: h5;
    counter-reset: h6;
    @media print {
        page-break-after: avoid !important;
    }
}

.mume h6 {
    font-weight: bold;
    margin-bottom: 2em;
    counter-increment: h6;
    @media print {
        page-break-after: avoid !important;
    }
}

.mume h2:before {
    content: counter(h2);
    margin-right: 2rem;
    /*这里是在编号后面加了缩进，效果： “1    Heading”*/
}

.mume h3:before

/** override the default style for focused headings */
    {
    /* 编号格式 */
    content: counter(h2) "."counter(h3);
    margin-right: 2rem;
}

.mume h4:before {
    content: counter(h2) "."counter(h3) "."counter(h4);
    margin-right: 2rem;
}

.mume h5:before {
    content: counter(h2) "."counter(h3) "."counter(h4) "."counter(h5);
    margin-right: 2rem;
}

.mume h6:before {
    content: counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) "."counter(h6);
    margin-right: 2rem;
}

/* 图像与分页 */
.mume img {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* TODO 图片自动编号，导出PDF时暂时无法显示 */
.mume img:after {
    counter-increment: imgHead;
    content: "图"counter(imgHead) attr(alt) " " !important;
    text-align: center;
    width: 100%;
    display: inline-block;
}


/* 目录自动编号 */
.toc ul {
    list-style: none;
    /* 去除ul中默认的样式*/
    counter-reset: nested-counter;
    color: #08c;
}

.toc ul li {
    counter-increment: nested-counter;
    line-height: 1.6;
}

.toc ul> :before {
    content: counters(nested-counter, ".") ") ";
    font-weight: bold;
}

/* 目录样式 */
.toc {
    background: #fefefe none repeat scroll 0 0;
    border: 1px dashed #aaa;
    display: block;
    font-size: 95%;
    margin-bottom: 1em;
    padding: 20px;
    width: auto;
    /* 2 倍段间距 */
    margin-bottom: 3em;
    text-align: center;
}

div.toc:before {
    content: '目录';
    font-weight: bold;
    text-align: center;
}

.toc ul {
    text-align: left;
}

.toc li,
.toc ul,
.toc ul li {
    list-style: outside none none !important;
    margin-bottom: 0em;
    margin-top: 0em;
}

/* 三线表 */
table>thead>tr>th {
    border-top: 2px solid #000;
    /* 表头首行上方粗线 */
    border-bottom: 1px solid #000;
    /* 表头首行下方细线 */
}

table>tbody>tr:last-child {
    border-bottom: 2px solid #000;
    /* 表体末行下方粗线 */
}

.mume table {
    font-size: 10.5pt;
    text-align: center;
    page-break-inside: avoid !important;
    table-layout: fixed !important;
    /*表格按内容宽度显示*/
    display: contents;
}

.mume thead {
    border-top: 1.5pt solid;
    border-bottom: 0.75pt solid;
    /* font-family: 黑体; */
    font-size: 10.5pt;
    text-align: center;
    font-weight: bold;
    background-color: #EEE;
}

.mume td {
    white-space: normal;
    text-align: justify;
    max-width: 100%;
}

/* 表格自动编号 */
/* .mume tbody:after {
    counter-increment: tableHead;
} */

.mume table>tfoot>tr>td{
    border-top-style: solid;
    border-top-color: black;
    border-top-width: 1px;
}

/* 显示表格自动编号 */
.mume table>tfoot>tr>td:after {
    counter-increment: tableHead;
    text-align: center;
    content: "表 "counter(tableHead) " ";
    width:100%;
	display:inline-block;
}

/* 适当拉宽ul和li的距离便于阅读 */
.mume ul {
    margin-bottom: 1em;
}

.mume li {
    margin-left: -1em;
    margin-bottom: 0.5em;
    margin-top: 0.5em;
}

/* 脚注中的p紧凑显示 */
.footnote-item>p {
    margin-bottom: 0em;
    text-indent: 0em;
    font-size: small;
}